import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.sql.*;
import java.util.*;
import CMST.*;

public class CheckUser extends GenericServlet
{
	/**
	 *veeresh java developer 
	 */
	private static final long serialVersionUID = 1L;

	public void service(ServletRequest request,ServletResponse response) throws ServletException, IOException
	{
			try
			{



		    response.setContentType("text/html");
			PrintWriter out = response.getWriter();
			String username = request.getParameter("user");
			System.out.println(username);
			Connection con=null;
			ConnectionBean CBean=new ConnectionBean();
			con=CBean.getConnection();

            ResultSet rs = CBean.executeQuery("Select * from customer_login where login_id= '" + username + "' ");

			if (rs.next())
			{
		    	out.println("already exists");
		    }else
		    {
				out.println("You Can Use This User Id");
		    }

	}
		catch(Exception e){ System.out.println("error"+e.getMessage());}
	}

}
